package com.cidp.system.service.impl;

import java.util.regex.Pattern;

import com.cidp.system.dao.IOperatorDetailDao;
import com.cidp.system.dao.IPermissionDao;
import com.cidp.system.service.IPermissionService;
import com.cidp.system.model.ToperatorDetail;
import com.cidp.system.model.Tpermission;
import com.litt.core.common.Utility;
import com.litt.core.exception.BusiException;
import com.litt.core.page.IPageList;
import com.litt.core.page.PagePoParam;
import com.litt.core.util.RegexUtils;


public class PermissionServiceImpl implements IPermissionService{
	
	private IPermissionDao permissionDao;
	
	
	public void setPermissionDao(IPermissionDao permissionDao) {
		this.permissionDao = permissionDao;
	}

	/**
	 * 删除记录
	 */
	public void deleteById(Long id)throws BusiException{
		Tpermission permission=this.load(id);
		permissionDao.deleteObject(permission);
	}

	public IPageList listByPage(PagePoParam pagePoParam) throws BusiException
	{
		return permissionDao.listByPage(pagePoParam);
	}
	/**
	 * 权限信息
	 * @param seNo 序号
	 * @return Tpermission对象
	 */
	public Tpermission load(Long seNo)  throws BusiException{
		if(seNo==null && Utility.isEmpty(seNo.toString())){
			throw new BusiException("序号为空字段！");
		}
		return (Tpermission)permissionDao.loadObject(Tpermission.class, seNo);
	}
	/**
     * 根据对象保存.
     * @param Tpermission 对象
     * @return Long 主键值
     */
	public Long save(Tpermission obj)  throws BusiException{
		if(obj.getPermissionCode()==null || Utility.isEmpty(obj.getPermissionCode())){
			throw new BusiException("权限编号为空字段！");
		}
		return permissionDao.saveObject(obj);
	}
	/**
     * 根据对象更新
     * @param Tpermission 对象
     */
	public void update(Tpermission obj)  throws BusiException{
		if(obj.getPermissionCode()==null || Utility.isEmpty(obj.getPermissionCode())){
			throw new BusiException("权限编号为空字段！");
		}
		permissionDao.updateObject(obj);
	}
	/**
     * 根据对象删除
     * @param Tpermission 对象
     */
	public void delete(Tpermission obj)  throws BusiException{
		permissionDao.deleteObject(obj);
	}
	/**
	 * 删除集合
	 * @param id
	 * @throws BusiException
	 */



}
